home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
public
/
jpeg
/
libCLRjpeg4
/
example
/
jsave.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
1KB
|
45 lines
#include <stdio.h>
#include <gl.h>
main(argc,argv)
int argc;
char *argv[];
{
if(argc == 2) {
noborder();
prefposition(0,0,0,0);
winopen("");
RGBmode();
fullscrn();
gconfig();
SaveJPEGImageScreen(argv[1],0,0,getgdesc(GD_XPMAX)-1,getgdesc(GD_YPMAX)-1);
} else if(argc == 6) {
noborder();
prefposition(0,0,0,0);
winopen("");
RGBmode();
fullscrn();
gconfig();
SaveJPEGImageScreen(argv[1],atoi(argv[2]),atoi(argv[3]),atoi(argv[4]),atoi(argv[5]));
} else {
Usage(argv[0]);
exit(2);
}
}
Usage(char *progname) {
fprintf(stderr,"usage: %s outfile [x1 y1 x2 y2]\n",progname);
fprintf(stderr,"outfile - the filename to give the saved JPEG image\n");
fprintf(stderr,"x1 y1 x2 y2 - the screen coordinates to save. If\n");
fprintf(stderr,"not specified, the complete screen will be saved.\n\n");
fprintf(stderr,"This program will save a jpeg image\n");
fprintf(stderr,"(in JFIF format and no arithmetic coding)\n");
fprintf(stderr,"of a section of an Iris screen. The encoding\n");
fprintf(stderr,"process utilizes the Independent JPEG Group's\n");
fprintf(stderr,"software (%s).\n",GetJPEGVersion());
fprintf(stderr,"IRIS GL(tm) Adaption is\n");
fprintf(stderr,"(c) 1992 Rodney Hoinkes, Centre for Landscape Research\n");
fprintf(stderr,"This software is public domain.\n");
exit(0);
}